<%- contentFor('body') %>
<div class="row justify-content-center" id="post-single">
  <div class="col-xl-6 col-lg-8">

    <!-- Title -->
    <h1 class="mt-4"><%= post.title %></h1>

    <!-- Author -->
    <p class="lead">
      by
      <a href="#">@<%= post.websiteSlug %></a>
    </p>

    <hr>

    <p class="post-date"><%= post.createdAt.toISOString() %></p>

    <hr>

    <%- post.content %>


  </div>
</div>

<script type="text/javascript" src="/js/moment.js"></script>
<script type="text/javascript" src="/js/locale/pt-br.js"></script>
<script type="text/javascript">

	$(document).ready(function() {

		const postDate = $(".post-date");

		$(this).find('.post-date').each(function(date, data){
			console.log();
			$(data).text(moment($(data).text()).calendar())
		});

	});
</script>